﻿namespace DataInterface
{
    public delegate void StartedHandler();
    public delegate void StopedHandler();
    public delegate void DataRecivedHandler(string content, params object[] obj);
    public delegate void ErrorNoticedHandler(string error);
    public delegate void WarnNoticedHandler(string error);
    public delegate void InfoNoticedHandler(string info);

    public interface IDataDrive
    {
        event StartedHandler Started;
        event StopedHandler Stoped;
        event DataRecivedHandler DataRecived;
        event ErrorNoticedHandler ErrorNoticed;
        event WarnNoticedHandler WarnNoticed;
        event InfoNoticedHandler InfoNoticed;
        
        string Name { get; }

        /// <summary>
        /// 数据源名称
        /// </summary>
        string SourceName { get; set; }
        /// <summary>
        /// 是否运行中
        /// </summary>
        bool Running { get; }

        /// <summary>
        /// 启动
        /// </summary>
        void Start();

        /// <summary>
        /// 停止
        /// </summary>
        void Stop();

        /// <summary>
        /// 释放
        /// </summary>
        void Dispose();
    }
}
